import React, {Component} from 'react';

class Topic extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        return (<li className="topicItem" onClick={()=>{this.props.onClick(this.props.topic)}}>
            <h3 className={"topicTitle " + (this.props.topic.top? "top":"share")}>{this.props.topic.title}</h3>
            <div className="content">
                <img className="avatar" src={this.props.topic.author.avatar_url}/>
                <div className="info">
                    <p>
                        <span className="name">{this.props.topic.author.loginname}</span>
                    <span className="status">
                        <b>{this.props.topic.reply_count}</b>/{this.props.topic.visit_count}
                    </span>
                    </p>
                    <p>
                        <time>11天前</time>
                        <time>22小时前</time>
                    </p>
                </div>
            </div>
        </li>);
    }
}

export default Topic;

